<?php

// Common.js
$js_file = 'common';

//
if(is_single()) {
	$js_file .= '_single';
	if(comments_open()) {
		$js_file .= '_comment-reply';
		$js_file .= '_comment-ajax';
	}
}
if(search_words()) {
	$js_file .= '_search-highlight';
}
if(igoogler_option('google-plus-one')) {
	$js_file .= '_google-plusone';
}
?>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/js/all-in-one.js.php?param=<?php echo $js_file;?>"></script>

<?php if(search_words()): $arr = preg_split('/[\s,]+/', search_words()); ?>
<script type="text/javascript"><!--//--><![CDATA[//><!--
$(document).ready(function(e) {
	<?php foreach($arr as $words):?>
	    $(".post").highlight("<?php echo $words;?>");
	<?php endforeach; ?>
});
//--><!]]></script>
<?php endif;?>
